package com.viking.web;


import com.viking.car.SocketHandler;

import java.net.ServerSocket;
import java.net.Socket;

public class StartServerThread extends Thread{
    private int port;

    public StartServerThread(int port) {
        this.port = port;
    }

    @Override
    public void run() {
        try {
            ServerSocket serverSocket = new ServerSocket(port);
            while (true){
                Socket socket = serverSocket.accept();
                new SocketHandler(socket).start();
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
